| Fully Qualified Name: | CodeIgniter\Database\Forge |
Class Forge
| Name | Description | Defined By |
|---|---|---|
| __construct() | Constructor. | Forge |
| addColumn() | Column Add | Forge |
| addField() | Add Field | Forge |
| addForeignKey() | Add Foreign Key | Forge |
| addKey() | Add Key | Forge |
| addPrimaryKey() | Add Primary Key | Forge |
| addUniqueKey() | Add Unique Key | Forge |
| createDatabase() | Create database | Forge |
| createTable() | Create Table | Forge |
| dropColumn() | Column Drop | Forge |
| dropDatabase() | Drop database | Forge |
| dropForeignKey() | Foreign Key Drop | Forge |
| dropTable() | Drop Table | Forge |
| getConnection() | Provides access to the forge's current database connection. | Forge |
| modifyColumn() | Column Modify | Forge |
| renameTable() | Rename Table | Forge |
| reset() | Reset | Forge |
Constructor.
| Parameter Name | Type | Description |
|---|---|---|
| $db | \CodeIgniter\Database\ConnectionInterface |
Returns:
Column Add
| Parameter Name | Type | Description |
|---|---|---|
| $table | string | Table |
| $field | string|array | Column |
Returns: bool
Add Field
| Parameter Name | Type | Description |
|---|---|---|
| $field | array|string |
Returns: \Forge
Add Foreign Key
| Parameter Name | Type | Description |
|---|---|---|
| $fieldName | string | |
| $tableName | string | |
| $tableField | string | |
| $onUpdate | string | |
| $onDelete | string |
Returns: \CodeIgniter\Database\Forge
Add Key
| Parameter Name | Type | Description |
|---|---|---|
| $key | string|array | |
| $primary | bool | |
| $unique | bool |
Returns: \Forge
Add Primary Key
| Parameter Name | Type | Description |
|---|---|---|
| $key | string|array |
Returns: \Forge
Add Unique Key
| Parameter Name | Type | Description |
|---|---|---|
| $key | string|array |
Returns: \Forge
Create database
| Parameter Name | Type | Description |
|---|---|---|
| $dbName | string | |
| $ifNotExists | bool | Whether |
Returns: bool
Create Table
| Parameter Name | Type | Description |
|---|---|---|
| $table | string | Table |
| $if_not_exists | bool | Whether |
| $attributes | array | Associative |
Returns: mixed
Column Drop
| Parameter Name | Type | Description |
|---|---|---|
| $table | string | Table |
| $column_name | string|array | Column |
Returns: mixed
Drop database
| Parameter Name | Type | Description |
|---|---|---|
| $dbName | string |
Returns: bool
Foreign Key Drop
| Parameter Name | Type | Description |
|---|---|---|
| $table | string | Table |
| $foreignName | string | Foreign |
Returns: bool|\CodeIgniter\Database\BaseResult|\CodeIgniter\Database\Query|mixed
Drop Table
| Parameter Name | Type | Description |
|---|---|---|
| $tableName | string | Table |
| $ifExists | bool | Whether |
| $cascade | bool | Whether |
Returns: mixed
Provides access to the forge's current database connection.
Returns: \ConnectionInterface
Column Modify
| Parameter Name | Type | Description |
|---|---|---|
| $table | string | Table |
| $field | string|array | Column |
Returns: bool
Rename Table
| Parameter Name | Type | Description |
|---|---|---|
| $table_name | string | Old |
| $new_table_name | string | New |
Returns: mixed
Reset
Resets table creation vars
Returns: void